{extend name="main"}
{block name="style"}
<style type="text/css">
	.flex-lable{width: 140px;color: #6c757d;text-align: right;padding-right: 10px;}
	.w-100px{width: 100px;}
	/*单选框去掉radio的小圆点*/
	#RemoveDots .el-radio__input{
		display: none;
	}
	.el-tag+.el-tag{
		margin-left: 10px;
	}
    .customerDetailsDialogclass{
		width: 710px;
		height: 760px;
	}
</style>
{/block}
{block name="body"}
<div class="bg-white mb-3">
	<el-form :model="search" @submit.native.prevent="submitForm" ref="search" label-position="right" class="flex py-3">

	  <el-form-item label="搜索类型" prop="search_type" class="flex mb-0 pl-3">
	  	<el-select v-model="search.search_type" placeholder="请选择" class="w-100px">
		    <el-option key="id"label="公司ID"value="id"></el-option>
		    <el-option key="uid"label="UID"value="uid"></el-option>
		    <el-option key="uscc"label="统一社会信用代码"value="uscc"></el-option>
		    <el-option key="company_name"label="公司名"value="company_name"></el-option>
		    <el-option key="contacts_mobile"label="联系人手机号"value="contacts_mobile"></el-option>
		    <el-option key="contacts_email"label="联系人邮箱"value="contacts_email"></el-option>
		</el-select>
	  </el-form-item>

<!--	  <el-form-item label="企业认证" prop="attestation" class="flex mb-0 pl-3">-->
<!--	  	<el-select v-model="search.attestation" placeholder="请选择" class="w-100px">-->
<!--		    <el-option key="all"label="全部"value="all"></el-option>-->
<!--		    <el-option v-for="v in attestation" :key="v.value":label="v.title":value="v.value"></el-option>-->
<!--		</el-select>-->
<!--	  </el-form-item>-->

<!--	  <el-form-item label="套餐" prop="vip_level" class="flex mb-0 pl-3">-->
<!--	  	<el-select v-model="search.vip_level" placeholder="请选择" class="w-100px">-->
<!--		    <el-option key="all"label="全部"value="all"></el-option>-->
<!--		    <el-option v-for="v in vip" :key="v.level":label="v.title":value="v.level" v-if="v.is_company"></el-option>-->
<!--		</el-select>-->
<!--	  </el-form-item>-->

	  <el-form-item :label="getSearchType()" prop="key" class="flex mb-0 pl-3">
	    <el-input v-model="search.key" placeholder="请输入你想搜索的关键词"></el-input>
	  </el-form-item>

	  <el-form-item class="flex mb-0 pl-3">
	    <el-button type="primary" @click="initHtml">查询</el-button>
	    <el-button @click="resetForm('search')">重置</el-button>
		<el-link style="margin-left: 10px" :underline="false" type="primary" @click="isShowForm()" @click.native="iconArrow()">高级查询<i :class="DownIcon"></i></el-link>
	  </el-form-item>
	</el-form>

	<div style="box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1)" >
		<el-tag
				v-for="tag in AdvancedSearchForm"
				:key="tag.title"
				size="small"
				disable-transitions="true"
				closable
				type="warning"
				@close="handleClose(tag)">
			{{tag.title}}
		</el-tag>
	</div>

<!--	高级搜索条件的开始-->
	<el-form v-if="iShowAdvancedSearchForm" label-width="120px" :model="AdvancedSearchForm" label-width="80px" style ="box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04)" id="RemoveDots" >
<!--		名企条件开始-->
		<el-form-item label="是否名企：" size="mini" ref="famousIts" >
			<el-radio-group  v-model="FamousEnterprises"  @change="advancedSearchRadioChange('famousIts','FamousEnterprises')">
				<el-radio-button     v-for="v in famousIts" :label="v.value">{{v.title}}</el-radio-button>
			</el-radio-group>
		</el-form-item>
<!--		名企条件结束-->
		<!--企业认证条件开始-->
		<el-form-item label="企业认证：" size="mini" ref="attData" >
			<el-radio-group  v-model="EnterpriseCertification"  @change="advancedSearchRadioChange('attData','EnterpriseCertification')">
				<el-radio-button  :label="-1" >全部</el-radio-button>
				<el-radio-button     v-for="v in attestation"  :label="v.value">{{v.title}}</el-radio-button>
			</el-radio-group>
		</el-form-item>
		<!--企业认证条件的结束-->

		<!--企业套餐条件开始-->
		<el-form-item label="企业套餐：" size="mini"  ref="vipData">
			<el-radio-group  v-model="EnterprisePackage" ref="vid" @change="advancedSearchRadioChange('vipData','EnterprisePackage')">
				<el-radio-button  :label="-1" >全部</el-radio-button>
				<el-radio-button  v-for="v in vipData" :label="v.value">{{v.title}}</el-radio-button>
			</el-radio-group>
		</el-form-item>
		<!--企业套餐条件的结束-->

<!--到期时间条件开始-->
		<el-form-item label="到期时间：" size="mini"  ref="vipExpirationIts">
			<el-radio-group  v-model="VipExpirationTime"  @change="advancedSearchRadioChange('vipExpirationIts','VipExpirationTime')">
				<el-radio-button     v-for="v in vipExpirationIts" :label="v.value">{{v.title}}</el-radio-button>
			</el-radio-group>
		</el-form-item>
<!--	到期时间的条件结束-->

	<!--最近登录时间条件开始-->
	<el-form-item label="最近登录：" size="mini"  ref="recentLoginIts">
		<el-radio-group  v-model="RecentLogin"    @change="advancedSearchRadioChange('recentLoginIts','RecentLogin')">
			<el-radio-button    v-for="v in recentLoginIts" :label="v.value">{{v.title}}</el-radio-button>

		</el-radio-group>
	</el-form-item>
	<!--	最近登录条件的结束-->

	<!--最近注册时间条件开始-->
	<el-form-item label="最近注册：" size="mini"  ref="recentlyRegisteredIts">
		<el-radio-group  v-model="RecentlyRegistered"   @change="advancedSearchRadioChange('recentlyRegisteredIts','RecentlyRegistered')">
			<el-radio-button     v-for="v in recentlyRegisteredIts" :label="v.value">{{v.title}}</el-radio-button>

		</el-radio-group>
	</el-form-item>
	<!--最近注册时间条件的结束-->

	<!--来源条件开始-->
	<el-form-item label="数据来源：" size="mini" ref="sourceIts" >
		<el-radio-group  v-model="source"    @change="advancedSearchRadioChange('sourceIts','source')">
			<el-radio-button     v-for="v in sourceIts" :label="v.value">{{v.title}}</el-radio-button>
		</el-radio-group>
	</el-form-item>
	<!--来源条件的结束-->
		<el-divider><el-button type="text" @click="isNotShowForm()">收起高级查询</el-button></el-divider>
	</el-form>

</div>
<div class="bg-white p-3">
	<div class="table-responsive py-3">
		  <el-button type="primary" size="mini" @click="exportCompany">导出 {{!selectNum?'':'('+selectNum+')'}}</el-button>
		  <el-button type="success" size="mini" icon="el-icon-refresh" @click="refreshCompanyALL">刷新</el-button>
		  <el-button type="primary" size="mini" @click="drawerHandle=true;">设置顾问</el-button>
		  <el-button type="primary" size="mini" @click="window.open('/company/importCompany')" plain>导入企业</el-button>
		  <el-button type="warning" size="mini" @click="window.open('/message/send')" plain>发消息</el-button>
		  <el-button type="primary" size="mini" @click="window.open('/company/addCompany')" plain>手动添加企业</el-button>
	</div>


<!--	//会员套餐修改-->
	<el-dialog
			:title="dialogTitle"
			:visible.sync="centerDialogVisible"
			@close="dialogClose"
			center
			custom-class="customerDetailsDialogclass">
		<hr/>
		<el-row >
			<el-col :span="12">
				<div class="flex flex-center mt-3">
					<div class="flex-lable" style="width: 130px;">会员套餐</div>
					<el-select v-model="giveFormVip" placeholder="选择套餐"  style="width:160px;!important">
						<el-option v-for="v in vip" :key="v.id" :label="v.title" :value="v.id" v-if="v.is_company"></el-option>
					</el-select>
				</div>
			</el-col>
			<el-col :span="12">
				<div class="flex flex-center mt-3">
					<div class="flex-lable" style="width: 130px;">额外天数</div>
					<el-input  v-model="giveFormVipDay" style="width:160px"></el-input>
				</div>
			</el-col>
		</el-row>
		<el-row v-for="(v,i) in vipRuleValueSelect" v-if="i%2==0"  >
			<el-col :span="12">
				<div class="flex flex-center mt-3">
					<div  class="flex-lable" style="width: 130px;">{{v.title}}</div>
					<el-input @input="inputOnInput($event)"  v-model="v.value" style="width:160px"></el-input>
				</div>
			</el-col>
			<el-col :span="12" v-if="i+1 < vipRuleValueSelect.length">
				<div class="flex flex-center mt-3">
					<div class="flex-lable" style="width: 130px;">{{vipRuleValueSelect[i+1].title}}</div>
					<el-input @input="inputOnInput($event)"  v-model="vipRuleValueSelect[i+1].value" style="width:160px"></el-input>
				</div>
			</el-col>
		</el-row>
		<div class="flex flex-center mt-3">
			<div class="flex-lable" style="width: 130px;">到期时间</div>
			<el-date-picker
					v-model="giveVipTime"
					align="right"
					type="date"
					format="yyyy-M-d"
					value-format="yyyy-M-d"
					placeholder="会员到期时间" style="width:160px">
			</el-date-picker>
		</div>
		<div class="bg-light p-2 rounded my-3 text-secondary small">
			<div>赠送套餐时间、权益将会累加</div>
			<div>如不修改会员到期时间<span class="text-danger">请勿选择</span></div>
		</div>
		<div slot="footer" class="dialog-footer">
			<el-button @click="dialogClose">取 消</el-button>
			<el-button type="primary" @click="giveCompanyVip(rowData)">确 定</el-button>
		</div>
	</el-dialog>

	<div class="table-responsive">
		<el-table
				ref="tableList"
	      :data="tableData"
    		v-loading="search.ajax"
    		style="width: 100%;"
    		header-cell-class-name="table-header-DDE6FB"
    		@expand-change="getCompanyInfo"
    		@selection-change="handleSelectionChange">
		  <el-table-column
			  type="selection"
			  width="55">
		  </el-table-column>
		  <el-table-column type="expand" width="20">
			  <template slot-scope="scope">
			  	<div v-if="scope.row.company_info==1">
				  	<div class="flex text-dark">
				  		<div class="flex-1 pr-2">
							<el-divider content-position="left">用户信息</el-divider>
				  			<div class="flex flex-center pb-3">
				  				<div class="flex-lable">用户</div>
								<el-image
								  	v-if="scope.row.data.headimg" 
								    style="width: 30px; height: 30px"
								    lazy
								    class="rounded-circle mr-2"
								    :src="scope.row.data.headimg" 
								    :preview-src-list="[scope.row.data.headimg]">
								</el-image>
				  				<div class="flex-1">
							      	<el-link :href="'/user?uid='+scope.row.uid" target="_blank"
							      	:underline="false"
							      	title="用户中心">{{scope.row.data.nickname}}</el-link>
				  				</div>
				  			</div>
				  			<div class="flex flex-center pb-3">
				  				<div class="flex-lable">手机号</div>
				  				<div class="flex-1">{{scope.row.data.mobile}}</div>
				  			</div>
				  			<div class="flex flex-center pb-3">
				  				<div class="flex-lable">邮箱</div>
				  				<div class="flex-1">{{scope.row.data.email}}</div>
				  			</div>
				  			<div class="flex flex-center pb-3" v-if="(!scope.row.data.adviser_id&&v.adviser_default)||(scope.row.data.adviser_id&&v.id==scope.row.data.adviser_id)" v-for="v in admin">
				  				<div class="flex-lable">顾问</div>
								<el-image
								  	v-if="v.headimg" 
								    style="width: 30px; height: 30px"
								    lazy
								    class="rounded-circle mr-2"
								    :src="v.headimg" 
								    :preview-src-list="[v.headimg]">
								</el-image>
				  				<div class="flex-1">
							      	<el-link
							      	:underline="false">{{v.nickname}}</el-link>
				  				</div>
				  			</div>
							<el-divider content-position="left">企业基本信息</el-divider>
				  			<div class="flex flex-center pb-3">
				  				<div class="flex-lable">ID</div>
				  				<div class="flex-1">{{scope.row.data.id}}</div>
				  			</div>
				  			<div class="flex flex-center pb-3">
				  				<div class="flex-lable">企业简称</div>
				  				<div class="flex-1">{{scope.row.data.stitle}}</div>
				  			</div>
				  			<div class="flex pb-3">
				  				<div class="flex-lable">企业认证</div>
			      				<div class="flex-1">
						      		<el-button v-for="v in attestation" :type="v.type" size="minism"
						      		v-if="scope.row.data.attestation==v.value">{{v.title}}</el-button>
			      				</div>
				  			</div>
				  			<div class="flex pb-3">
				  				<div class="flex-lable">营业执照</div>
			      				<div class="flex-1" >
								  <el-image
								  	v-if="scope.row.data.business_license" 
								  	class="mw-50px mh-50px"
								    :src="scope.row.data.business_license"
								    :preview-src-list="[scope.row.data.business_license]">
								  </el-image>
								  <div v-else class="text-secondary small">未上传</div>
			      				</div>
				  			</div>
				  			<div class="flex flex-center pb-3">
				  				<div class="flex-lable">统一社会信用代码</div>
			      				<div class="flex-1">{{scope.row.data.uscc}}</div>
				  			</div>
				  			<div class="flex pb-3">
				  				<div class="flex-lable">企业LOGO</div>
			      				<div class="flex-1" >
								  <el-image
								  	v-if="scope.row.data.logo" 
								  	class="mw-50px mh-50px"
								    :src="scope.row.data.logo"
								    :preview-src-list="[scope.row.data.logo]">
								  </el-image>
								  <div v-else class="text-secondary small">未上传</div>
			      				</div>
				  			</div>
				  			<div class="flex flex-center pb-3">
				  				<div class="flex-lable">企业性质</div>
			      				<div class="flex-1" v-for="v in nature" v-if="scope.row.data.nature==v.value">{{v.title}}</div>
				  			</div>
				  			<div class="flex flex-center pb-3">
				  				<div class="flex-lable">融资阶段</div>
			      				<div class="flex-1" v-for="v in finance" v-if="scope.row.data.finance==v.value">{{v.title}}</div>
				  			</div>
				  			<div class="flex flex-center pb-3">
				  				<div class="flex-lable">所属行业</div>
			      				<div class="flex-1">{{scope.row.data.industry}}</div>
				  			</div>
				  			<div class="flex flex-center pb-3">
				  				<div class="flex-lable">公司规模</div>
			      				<div class="flex-1" v-for="v in size_type" v-if="scope.row.data.size_type==v.value">{{v.title}}</div>
				  			</div>
				  			<div class="flex flex-center pb-3">
				  				<div class="flex-lable">注册资金</div>
			      				<div class="flex-1">{{scope.row.data.registered_capital}}万{{scope.row.data.registered_capital?'人民币':'美元'}}</div>
				  			</div>
				  			<div class="flex pb-3">
				  				<div class="flex-lable">企业福利</div>
			      				<div class="flex-1"><el-tag size="small" type="success" v-for="v in corporate_welfare" v-if="scope.row.data.corporate_welfare.indexOf(v.value)>=0" class="mr-2">{{v.title}}</el-tag></div>
				  			</div>
				  		</div>
				  		<div class="flex-1 pl-2">
							<el-divider content-position="left">企业拓展信息</el-divider>
				  			<div class="flex flex-center pb-3">
				  				<div class="flex-lable">企业联系人</div>
			      				<div class="flex-1">{{scope.row.data.contacts}}</div>
				  			</div>
				  			<div class="flex flex-center pb-3">
				  				<div class="flex-lable">联系人手机号</div>
			      				<div class="flex-1">{{scope.row.data.contacts_mobile}}</div>
				  			</div>
				  			<div class="flex flex-center pb-3">
				  				<div class="flex-lable">固定电话</div>
			      				<div class="flex-1">{{scope.row.data.contacts_tel}}</div>
				  			</div>
				  			<div class="flex flex-center pb-3">
				  				<div class="flex-lable">联系邮箱</div>
			      				<div class="flex-1">{{scope.row.data.contacts_email}}</div>
				  			</div>
				  			<div class="flex flex-center pb-3">
				  				<div class="flex-lable">公司地址</div>
			      				<div class="flex-1">{{scope.row.data.contacts_address}}</div>
				  			</div>
				  			<div class="flex pb-3">
				  				<div class="flex-lable">公司网址</div>
			      				<div class="flex-1">{{scope.row.data.company_website}}</div>
				  			</div>
				  			<div class="flex pb-3">
				  				<div class="flex-lable">公司简介</div>
			      				<div class="flex-1" v-html="XYBase.strntobr(scope.row.data.company_introduction)"></div>
				  			</div>
				  			<div class="flex pb-3">
				  				<div class="flex-lable">公司介绍</div>
			      				<div class="flex-1" v-html="XYBase.strntobr(scope.row.data.company_descript)"></div>
				  			</div>
				  		</div>
				  	</div>
				  	<div class="py-3">
				        <el-button
				            type="primary"
				            size="minism"
				            @click="window.open('/company/editCompany/'+scope.row.id)">
				            编辑
				        </el-button>
				        <el-button
				            type="success"
				            size="minism"
				            @click="window.open('/jobs/addJobs/'+scope.row.id)">
				            发布职位
				        </el-button>
				        <el-button
				            type="primary"
				            size="minism"
				            @click="drawerHandleFind=scope.row;drawerHandle=true;">
				            设置顾问
				        </el-button>
				        <el-button
				            type="info"
				            size="minism"
				            @click="window.open('/user/loginLog?uid='+scope.row.uid)">
				            登录日志
				        </el-button>
				        <el-button
				            type="info"
				            size="minism"
				            @click="window.open('/user/apiLog?uid='+scope.row.uid)">
				            操作日志
				        </el-button>
				        <el-button
				            type="info"
				            size="minism"
				            @click="window.open('{:config('web.url')}/company/'+scope.row.id+'.html')">
				            浏览
				        </el-button>
				  	</div>
			  	</div>
			  	<div class="text-center py-5 text-secondary small" v-else-if="scope.row.company_info==0">
			  		<i class="el-icon-loading mr-2"></i>加载中...
			  	</div>
			  	<div class="text-center py-5 text-secondary small" v-else="scope.row.company_info">
			  		未获取到用户信息
			  	</div>
			  </template>
		  </el-table-column>
	      <el-table-column
	        prop="uid"
	        label="UID"
	        width="100">
	      </el-table-column>
	      <el-table-column
	      	prop="title"
	        label="公司信息"
	        min-width="200">
		      <template slot-scope="scope">
		      	<div>
		      	<el-link @click="openWinTo(scope.row)"
		      	:underline="false"
		      	title="免登录跳转至用户中心">{{scope.row.title}}</el-link>
		      	<div class="text-primary">{{scope.row.mobile}}</div>
		      	</div>
		      </template>
	      </el-table-column>
	      <el-table-column
	        label="企业认证"
	        width="120">
		      <template slot-scope="scope">
		      	<transition>
		      		<el-button v-for="v in attestation" :type="v.type" size="minism"
		      		v-if="scope.row.attestation==v.value"
		      		@click="window.open('/company/attestation?uid='+scope.row.uid)">{{v.title}}</el-button>
						</transition>
		      </template>
	      </el-table-column>
	      <el-table-column
	        label="职位数"
	        width="120">
		      <template slot-scope="scope">
		      	<div>
			      	<div><span class="text-danger">{{scope.row.jobs_count}}</span>个</div>
			      	<el-link type="primary" :href="'/jobs/addJobs/'+scope.row.id" :underline="false" target="_blank" v-if="scope.row.attestation==3">添加</el-link>
		      	</div>
		      </template>
	      </el-table-column>
	      <el-table-column
	        prop="app_name"
	        label="来源"
	        width="160">
	      </el-table-column>
	      <el-table-column
	        label="会员"
	        width="160">
		      <template slot-scope="scope">
		      	<div >
<!--		      		<div class="flex">-->
<!--			      		<div>{{scope.row.vip_title}}</div>-->
<!--						<el-popover-->
<!--						placement="left"-->
<!--						width="710"-->
<!--						trigger="click">-->
<!--							<div class="pb-3" style="font-size:18px;text-align: center;">-->
<!--								{{scope.row.title}}-->
<!--							</div>-->
<!--							<el-divider style="margin:0;!important"></el-divider>-->
<!--							<el-row >-->
<!--								<el-col :span="12">-->
<!--									<div class="flex flex-center mt-3">-->
<!--										<div class="flex-lable" style="width: 130px;">会员套餐</div>-->
<!--										<el-select v-model="giveFormVip" placeholder="选择套餐"  style="width:150px;!important">-->
<!--											<el-option v-for="v in vip" :key="v.id" :label="v.title" :value="v.id" v-if="v.is_company"></el-option>-->
<!--										</el-select>-->
<!--									</div>-->
<!--								</el-col>-->
<!--									<el-col :span="12">-->
<!--									<div class="flex flex-center mt-3">-->
<!--										<div class="flex-lable" style="width: 130px;">额外天数</div>-->
<!--										<el-input-number v-model="giveFormVipDay" :step="1" step-strictly-->
<!--														 :min="0"-->
<!--														 controls-position="right"-->
<!--														 placeholder="额外天数" style="width:150px"></el-input-number>-->
<!--									</div>-->
<!--								</el-col>-->
<!--							</el-row>-->
<!--&lt;!&ndash;							<div class="flex flex-center mt-3"  v-for="v in vipRuleValueSelect">&ndash;&gt;-->
<!--&lt;!&ndash;								<div class="flex-lable" style="width: 80px;">{{v.title}}</div>&ndash;&gt;-->
<!--&lt;!&ndash;								<el-input-number v-model="v.value"></el-input-number>&ndash;&gt;-->
<!--&lt;!&ndash;							</div>&ndash;&gt;-->


<!--							<el-row v-for="(v,i) in vipRuleValueSelect" v-if="i%2==0"  >-->
<!--								<el-col :span="12">-->
<!--									<div class="flex flex-center mt-3">-->
<!--										<div  class="flex-lable" style="width: 130px;">{{v.title}}</div>-->
<!--										<el-input :label="v.title" v-model="v.value" style="width:150px"></el-input>-->
<!--									</div>-->
<!--								</el-col>-->
<!--								<el-col :span="12" v-if="i+1 < vipRuleValueSelect.length">-->
<!--									<div class="flex flex-center mt-3">-->
<!--										<div class="flex-lable" style="width: 130px;">{{vipRuleValueSelect[i+1].title}}</div>-->
<!--										<el-input  v-model="vipRuleValueSelect[i+1].value" style="width:150px"></el-input>-->
<!--									</div>-->
<!--								</el-col>-->
<!--							</el-row>-->


<!--							<div class="flex flex-center mt-3">-->
<!--								<div class="flex-lable" style="width: 130px;">到期时间</div>-->
<!--							    <el-date-picker-->
<!--							      v-model="giveVipTime"-->
<!--							      align="right"-->
<!--							      type="date"-->
<!--							      format="yyyy-M-d"-->
<!--							      value-format="yyyy-M-d"-->
<!--							      placeholder="会员到期时间" style="width:150px">-->
<!--							    </el-date-picker>-->
<!--							</div>-->
<!--							<div class="bg-light p-2 rounded my-3 text-secondary small">-->
<!--								<div>赠送套餐时间、权益将会累加</div>-->
<!--								<div>如不修改会员到期时间<span class="text-danger">请勿选择</span></div>-->
<!--							</div>-->
<!--				      		<div class="flex">-->
<!--				      			<div class="flex-1"></div>-->
<!--							  		<el-button type="primary" size="mini"-->
<!--							  		@click="giveCompanyVip(scope.row)">修改</el-button>-->
<!--							  	</div>-->
<!--		      				<div class="ml-1 text-primary pointer" slot="reference">修改</div>-->
<!--						</el-popover>-->
<!--		      		</div>-->
					<div class="flex">
						<div>{{scope.row.vip_title}}</div>
						<div class="ml-1 text-primary pointer" slot="reference" @click="centerDialogView(scope.row)">修改</div>
					</div>
					<div v-if="scope.row.company_vip_time">{{scope.row.company_vip_time}}</div>
			      	<div v-else>不限</div>
		      	</div>
		      </template>

	      </el-table-column>
	      <el-table-column
	        label="名企"
	        width="100">
		      <template slot-scope="scope">
					<div>
		      	<transition>
		      		<el-button type="success" size="minism"
		      		v-if="scope.row.is_famous==1 || scope.row.is_famous=='loading'"
		      		@click="setIsFamous(scope.row);" 
		      		:loading="scope.row.is_famous=='loading'">是</el-button>
		      		<el-button type="info" size="minism" 
		      		v-else-if="scope.row.is_famous==0 || scope.row.is_famous=='loading'" 
		      		@click="setIsFamous(scope.row);" 
		      		:loading="scope.row.is_famous=='loading'">否</el-button>
						</transition>
					</div>
		      </template>
	      </el-table-column>
	      <el-table-column
	        label="创建/更新/刷新时间"
	        width="180">
		      <template slot-scope="scope">
		      	<div class="small">
		          <div>{{ scope.row.create_time }}</div>
		          <div>{{ scope.row.update_time }}</div>
		          <div>{{ scope.row.refresh_time }}</div>
		      	</div>
		      </template>
	      </el-table-column>
	      <el-table-column
	        label="/"
	        width="200">
		      <template slot-scope="scope">
		        <el-button
		            type="success"
		            plain
		            round
		            size="minism"
		            @click="Business.openBusiness(scope.row.id,true)">
		            业务
		        </el-button>
		        <el-button
		            type="primary"
		            plain
		            round
		            size="minism"
		            @click="window.open('/company/editCompany/'+scope.row.id)">
		            编辑
		        </el-button>
		        <el-button
		            type="danger"
		            plain
		            round
		            size="minism"
		            @click="setCompanyDelete(scope)">
		            回收站
		        </el-button>
		      </template>
	      </el-table-column>
	    </el-table>
	</div>
	<div class="table-responsive py-3 text-center">
		<el-pagination
		  background
	      @size-change="handleSizeChange"
	      @current-change="handleCurrentChange"
	      :current-page="search.page"
	      :page-sizes="[10,50,100,200,500,1000]"
	      :page-size="search.pageSize"
	      layout="total, sizes, prev, pager, next, jumper"
	      :total="search.total">
	    </el-pagination>
	</div>
</div>
<el-drawer
  title="我是标题"
  :visible.sync="drawerHandle"
  :with-header="false"
  :before-close="closeDrawerHandle">
  	<div class="wrap h-100">
		<div class="flex px-3 py-2">
			<div class="flex-1 block-title-before py-2">设置顾问</div>
			<div class="py-2">
		  		<div class="small" v-if="drawerHandleFind.id">{{drawerHandleFind.title}}</div>
		  		<div class="small" v-else>批量设置</div>
			</div>
		</div>
		<div class="flex1 p-3" style="overflow-y: auto;">
			<div class="flex flex-center border border-lg rounded-lg mb-3 p-3 pointer"
			v-for="v in admin"
			:class="{'border-primary':adviser.id==v.id}"
			@click="adviser=v">
				<el-image
				  	v-if="v.headimg" 
				    style="width: 60px; height: 60px"
				    lazy
				    class="rounded-circle mr-2"
				    :src="v.headimg" 
				    :preview-src-list="[v.headimg]">
				</el-image>
  				<div class="flex-1">
			      	<el-link
			      	:underline="false">{{v.nickname}}</el-link>
  				</div>
  				<div class="text-secondary small" v-if="v.adviser_default">默认</div>
			</div>
		</div>
	  	<div class="flex px-3 py-2">
	  		<div class="flex-1">
			    <el-button @click="drawerHandle=false;drawerHandleFind={};">关闭</el-button>
		    </div>
	  		<div v-if="drawerHandleFind.id">
		    	<el-button type="primary" @click="setAdviser(drawerHandleFind)">设置</el-button>
		    </div>
	  		<div v-else>
		    	<el-button type="primary" @click="setAdviserALL()">设置</el-button>
		    </div>
	  	</div>
  	</div>
</el-drawer>
{/block}
{block name="script"}
<script type="text/javascript">
	{empty name="admin"}
	var admin=[];
	{else/}
	var admin={:json_encode($admin,JSON_UNESCAPED_UNICODE)};
	{/empty}
	{empty name="attestation"}
	var attestation=[];
	{else/}
	var attestation={:json_encode($attestation,JSON_UNESCAPED_UNICODE)};
	{/empty}
	{empty name="nature"}
	var nature=[];
	{else/}
	var nature={:json_encode($nature,JSON_UNESCAPED_UNICODE)};
	{/empty}
	{empty name="finance"}
	var finance=[];
	{else/}
	var finance={:json_encode($finance,JSON_UNESCAPED_UNICODE)};
	{/empty}
	{empty name="industry"}
	var industry=[];
	{else/}
	var industry={:json_encode($industry,JSON_UNESCAPED_UNICODE)};
	{/empty}
	{empty name="size_type"}
	var size_type=[];
	{else/}
	var size_type={:json_encode($size_type,JSON_UNESCAPED_UNICODE)};
	{/empty}
	{empty name="corporate_welfare"}
	var corporate_welfare=[];
	{else/}
	var corporate_welfare={:json_encode($corporate_welfare,JSON_UNESCAPED_UNICODE)};
	{/empty}
	{empty name="vip"}
	var vip=[];
	{else/}
	var vip={:json_encode($vip,JSON_UNESCAPED_UNICODE)};
	{/empty}
	{empty name="vipRule"}
		var vipRule=[];
	{else/}
	 	var vipRule={:json_encode($vipRule,JSON_UNESCAPED_UNICODE)};
	{/empty}
	{empty name="vipRuleValue"}
		var vipRuleValue=[];
	{else/}
		var vipRuleValue={:json_encode($vipRuleValue,JSON_UNESCAPED_UNICODE)};
	{/empty}
</script>
<script type="text/javascript">
	var loading=null;
	var vm=new Vue({
		el:'#app',
		computed:{
			vipData(){
				let result = [];
				 this.vip.map((item)=>{
					if (item.is_company==1){
						result.push( {title:item.title,value:item.level} )
					}
				})
				return result;
			},
			attData() {
				return this.attestation;
			},
			vipRuleValueSelect(){
				let result=[];
				this.vipRule.map((item)=>{
					if (item.vid==this.giveFormVip){
						this.vipRuleValue.map((value)=>{
							if (value.id==item.rid){
								result.push({title:value.title,value:item.value,unit:value.unit,alias:value.alias})
							}
						})
					}
				})
				return result;
			}
		},
		data:{
			view:XYBase.view,
			vip:vip,
			vipRule:vipRule,
			form:'',
			//套餐数值
			vipRuleValue:vipRuleValue,
			centerDialogVisible: false,
			rowData:[],
			dialogTitle: "企业会员等级修改",
			labelPosition:'right',
			drawerHandle:false,
			drawerHandleFind:{},
			admin:admin,
			adviser:{id:0},
			attestation:attestation,
			nature:nature,
			finance:finance,
			industry:industry,
			size_type:size_type,
			corporate_welfare:corporate_welfare,
			multipleSelection:[],
			//箭头方向，默认向下
			isDownIcon:true,
			DownIcon:"el-icon-arrow-down  el-icon--right",

			selectNum:0,
			//是否显示高级搜索的表单
			iShowAdvancedSearchForm:false,
			//已选择的高级条件标签
			AdvancedSearchTags:[],
			//名企单选框，默认为全部
			FamousEnterprises:-1,
			//企业认证单选框，默认为全部
			EnterpriseCertification:-1,
			//企业套餐单选框，默认为全部
			EnterprisePackage:-1,
			//到期时间单选框，默认为全部
			VipExpirationTime:-1,
			//最近登录单选框，默认为全部
			RecentLogin:-1,
			//最近注册单选框，默认为全部
			RecentlyRegistered:-1,
			//来源单选框，默认为全部
			source:-1,
			famousIts:[
				{value:-1,title:"全部"},
				{value:1,title:"名企"},
				{value:0,title:"非名企"}
			],
			vipExpirationIts:[
				{value:-1,title:"全部"},
				{value:0,title:"今天"},
				{value:3,title:"最近三天"},
				{value:7,title:"最近七天"},
				{value:30,title:"最近一个月"}
			],
			recentLoginIts:[
				{value:-1,title:"全部"},
				{value:0,title:"今天"},
				{value:3,title:"最近三天"},
				{value:7,title:"最近七天"},
				{value:30,title:"最近一个月"}
			],
			recentlyRegisteredIts:[
				{value:-1,title:"全部"},
				{value:0,title:"今天"},
				{value:3,title:"最近三天"},
				{value:7,title:"最近七天"},
				{value:30,title:"最近一个月"}
			],
			sourceIts:[
				{value:-1,title:"全部"},
				{value:1,title:"PC"},
				{value:4,title:"H5"},
				{value:6,title:"微信小程序"},
				{value:2,title:"APP"},
				{value:8,title:"抖音小程序"},
				{value:9,title:"百度小程序"},
				{value:10,title:"支付宝小程序"},
				{value:11,title:"快手小程序"},
				{value:null,title:"后台添加"},
			],

			//高级搜索的表单
			AdvancedSearchForm:[],
			search:{
				{notempty name=":request()->get('uid')"}
				search_type:'uid',
				key:'{:request()->get('uid')}',
				{elseif request()->get('id')/}
				search_type:'id',
				key:'{:request()->get('id')}',
				{elseif request()->get('uscc')/}
				search_type:'uscc',
				key:'{:request()->get('uscc')}',
				{elseif request()->get('company_name')/}
				search_type:'company_name',
				key:'{:request()->get('company_name')}',
				{elseif request()->get('contacts_mobile')/}
				search_type:'contacts_mobile',
				key:'{:request()->get('contacts_mobile')}',
				{elseif request()->get('contacts_email')/}
				search_type:'contacts_email',
				key:'{:request()->get('contacts_email')}',
				{else/}
				search_type:'id',
				key:'',
				{/notempty}
				attestation:'all',
				vip_level:'all',
				ajax:false,
				page:1,
				total:0,
				pageSize:10
			},
			tableData:[],
			giveFormVip:'',
			giveVipTime:'',
			giveFormVipDay:0,
		},
		watch:{
		    view:XYBase.viewWatch,
		},
		created(){
			XYBase.created(this);
		},
	    methods: {
	    	giveCompanyVip(row){
	    		if(!this.giveFormVip&&!this.giveFormVipDay&&!this.giveVipTime)return XYBase.msg('请选择套餐，额外天数，会员到期时间');
	    		var vip_title='',title='';
	    		if(this.giveFormVip){
		    		for (var i = 0; i < this.vip.length; i++) {
		    			if(this.vip[i].id===this.giveFormVip){
		    				vip_title=this.vip[i].title;
		    				break;
		    			}
		    		}
		    		if(!vip_title)return XYBase.msg('请选择套餐');
	    		}

				if (vip_title&&this.giveFormVipDay) {
		    		title='确定将【'+vip_title+'】套餐和【'+this.giveFormVipDay+'天】额外会员天数赠送给【'+row.title+'】吗？';
	    		}else if (vip_title&&!this.giveFormVipDay){
		    		title='确定将【'+vip_title+'】套餐赠送给【'+row.title+'】吗？';
	    		}else if (!this.giveFormVip&&this.giveFormVipDay){
		    		title='确定赠送【'+this.giveFormVipDay+'天】额外会员天数给【'+row.title+'】吗？';
	    		}else if (!this.giveFormVip&&!this.giveFormVipDay&&this.giveVipTime){
		    		title='确定修改【'+row.title+'】的会员到期时间为【'+this.giveVipTime+'】吗？';
	    		}
	    		var _this=this;
				// console.log(this.giveFormVip);
				// console.log(this)

				_this = {...this}

				var id=this.giveFormVip;
				var vipRuleValueSelect=this.vipRuleValueSelect
				var giveVipTime=this.giveVipTime
				var giveFormVipDay=this.giveFormVipDay
				var uid=row.uid


				this.$confirm(title, '提示', {
		        	dangerouslyUseHTMLString:true,
		          	confirmButtonText: '确定',
		          	cancelButtonText: '取消',
		          	type: 'warning'
		        }).then(() => {
					var loadinger = XYBase.openloading();
					$.ajax({
						url:'/company/giveCompanyVip',
						type:'post',
						data:{
							id:id,
							day:giveFormVipDay,
							time:giveVipTime,
							uid:uid,
							vipRuleValueSelect:vipRuleValueSelect
						},
						dataType:'json',
						error:function(err){
							this.giveFormVip='';
					        loadinger.close();
				          	XYBase.error(XYBase.config.system_network_error);
						},
						success:function(ret){
							this.giveFormVip='';
					        loadinger.close();
							if (ret) {
								if (ret.code === 0) {
									if (ret.data.vip_title)
									row.vip_title=ret.data.vip_title;
									row.company_vip_time=ret.data.company_vip_time;
									_this.giveVipTime='';
									XYBase.success(ret.msg);
								}else XYBase.msg(ret.msg);
							}else XYBase.error(XYBase.config.system_network_error);
							_this.vipRuleValueSelect=[];
						}
					})
		        }).catch(() => {
					XYBase.msg('已取消');
		        });
				this.centerDialogVisible=false;
				this.rowData=[];
	    	},
	    	closeDrawerHandle(done){
	    		this.drawerHandleFind={};
	    		done();
	    	},
	    	openWinTo(row){
		        this.$confirm('即将免登录打开【'+row.title+'】,是否继续？', '提示', {
		        	dangerouslyUseHTMLString:true,
		          confirmButtonText: '继续',
		          cancelButtonText: '取消',
		          type: 'warning'
		        }).then(() => {
	    			window.open('user/exemptLoginRedirect/'+row.uid+'?path=/user/account');
		        }).catch(() => {
					XYBase.msg('已取消');
		        });
	    	},
		    toggleSelection(rows) {
		        if (rows) {
		          rows.forEach(row => {
		            this.$refs.tableList.toggleRowSelection(row);
		          });
		        } else {
		          this.$refs.tableList.clearSelection();
		        }
		    },
		    handleSelectionChange(val) {
		        this.multipleSelection = val;
				this.selectNum=val.length;
		    },
	    	getSearchType(){
	    		var text='公司ID';
	    		switch(this.search.search_type){
	    			case 'id':
	    				text='公司ID';
	    				break;
	    			case 'uid':
	    				text='UID';
	    				break;
	    			case 'uscc':
	    				text='统一社会信用代码';
	    				break;
	    			case 'company_name':
	    				text='公司名';
	    				break;
	    			case 'contacts_mobile':
	    				text='联系人手机号';
	    				break;
	    			case 'contacts_email':
	    				text='联系人邮箱';
	    				break;
	    		}
	    		return text;
	    	},
			//点击显示高级表单按钮
			isShowForm:function(){
				this.iShowAdvancedSearchForm=!this.iShowAdvancedSearchForm;
				this.isDownIcon=!this.isDownIcon;
			},
			//鼠标悬停效果
			iconArrow:function(){
				if (this.isDownIcon){
					this.DownIcon="el-icon-arrow-down  el-icon--right";
				}else {
					this.DownIcon="el-icon-arrow-up  el-icon--right";
				}
			},
			//点击收起高级查询按钮
			isNotShowForm:function(){
				this.iShowAdvancedSearchForm=false;
			},
			//高级搜索选择条件的事件
			advancedSearchRadioChange(searchName,modeName){
				let _this = this;
				let title="";
				let isPush=true;
				let numData=_this[searchName];
				//获取当前条件的前缀
					getTitle = numData.map((item)=>{
						if (item.value==_this[modeName]){
							title= item.title;
						}
					})
				//判断当前条件的前缀是否存在
				_this.AdvancedSearchForm.forEach((item,index)=>{
						if (item.value==modeName){
							_this.AdvancedSearchForm.splice(index,1);
						}
						if (_this[item.value]==-1){
							_this.AdvancedSearchForm.splice(index,1);
								isPush=false;
						}
				})
				if (isPush){
					this.AdvancedSearchForm.push({
						title:_this.$refs[searchName].label+title,
						value:modeName,
						index:_this[modeName]
					})
				}
				//发起请求获取对应条件的列表数据
				this.advancedSearch();
			},
			//高级搜索条件标签关闭
			handleClose:function(tag){
				let _this = this;
				_this.AdvancedSearchForm.forEach((item,index)=>{
					if (item.value==tag.value){
						_this.AdvancedSearchForm.splice(index,1);
						_this[item.value]=-1;
					}
				})
				this.advancedSearch();
			},
			resetForm:function(formName) {
				this.$refs[formName].resetFields();
				this.AdvancedSearchForm.map((item)=>{
					this[item.value]=-1;
				})
				this.AdvancedSearchForm=[];
			},
			handleSizeChange(val) {
				this.search.page=1;
				this.search.pageSize=val;
				if (this.AdvancedSearchForm.length>0){
					this.advancedSearch();
				}else {
					this.initHtml();
				}
			},
			handleCurrentChange(val) {
				this.search.page=val;
				if (this.AdvancedSearchForm.length>0){
					this.advancedSearch();
				}else {
					this.initHtml();
				}
			},
			setIsFamous(data){
	    		if (data.is_famous=='loading') return;
	    		var is_famous=1,oldStatus=data.is_famous;
	    		if (data.is_famous) is_famous=0;
	    		data.is_famous='loading';
	    		$.getJSON('/company/setIsFamous/'+data.id+'/'+is_famous,function(ret){
	    			data.is_famous=oldStatus;
	    			if (ret) {
	    				if (ret.code === 0) {
	    					data.is_famous=is_famous;
	    				}else{
	    					XYBase.msg(ret.msg);
	    				}
	    			}else{
						XYBase.error(XYBase.config.system_network_error);
	    			}
	    		});
			},
    	setCompanyDelete(scope){
    		var _this=this;
	        _this.$confirm('确定将《'+scope.row.title+'》放入回收站吗？', '提示', {
	          confirmButtonText: '确定',
	          cancelButtonText: '取消',
	          type: 'warning'
	        }).then(() => {
	    		$.getJSON('/company/setCompanyDelete/'+scope.row.id,function(ret){
	    			if (ret) {
	    				if (ret.code === 0) {
	    					_this.tableData.splice(scope.$index,1);
	    				}else{
	    					XYBase.msg(ret.msg);
	    				}
	    			}else{
						XYBase.error(XYBase.config.system_network_error);
	    			}
	    		});
	        }).catch(() => {
  				XYBase.msg('已取消');
	        });
    	},
			setAdviser(row){
				var _this=this;
				if(!_this.adviser.id) return XYBase.msg('请先选择顾问');
				_this.drawerHandle=false;
				var loadinger = XYBase.openloading();
				$.ajax({
					url:'/company/setAdviser/'+row.id+'/'+_this.adviser.id,
					type:'get',
					data:{},
					dataType:'json',
					error:function(err){
				        loadinger.close();
			          	XYBase.error(XYBase.config.system_network_error);
					},
					success:function(ret){
				        loadinger.close();
						if (ret) {
							if (ret.code === 0) {
								row.data.adviser_id=_this.adviser.id;
								XYBase.success(ret.msg);
							}else XYBase.msg(ret.msg);
						}else XYBase.error(XYBase.config.system_network_error);
					}
				})
			},
			setAdviserALL(){
				var _this=this;
				if(!_this.adviser.id) return XYBase.msg('请先选择顾问');
				if (_this.multipleSelection.length<1)return;
				_this.drawerHandle=false;
				loading = XYBase.openloading();
				_this.multipleSelectionIndex=0;
				_this.setAdviserALLAjax();
			},
			setAdviserALLAjax(){
				var _this=this;
				var D=_this.multipleSelection[_this.multipleSelectionIndex];
				if (D) {
					loading.setText((_this.multipleSelectionIndex+1)+'/'+_this.multipleSelection.length);
					$.ajax({
						url:'/company/setAdviser/'+D.id+'/'+_this.adviser.id,
						type:'get',
						data:{},
						dataType:'json',
						error:function(err){
				          	loading.close();
							_this.multipleSelectionIndex=0;
					        _this.$refs.tableList.clearSelection();
						},
						success:function(ret){
							if (ret) {
								if(ret.code === 0){
									_this.multipleSelection[_this.multipleSelectionIndex].data.adviser_id=_this.adviser.id;
									_this.multipleSelectionIndex++;
									_this.setAdviserALLAjax();
								}else{
									_this.multipleSelectionIndex++;
									_this.setAdviserALLAjax();
								}
							}else{
								XYBase.error(XYBase.config.system_network_error);
					          	loading.close();
								_this.multipleSelectionIndex=0;
						        _this.$refs.tableList.clearSelection();
							}
						}
					})
				}else{
		          	loading.close();
					_this.multipleSelectionIndex=0;
			        _this.$refs.tableList.clearSelection();
				}
			},
			refreshCompanyALL(){
				var _this=this;
				if (_this.multipleSelection.length<1)return;
				loading = XYBase.openloading();
				_this.multipleSelectionIndex=0;
				_this.refreshCompanyALLAjax();
			},
			refreshCompanyALLAjax(){
				var _this=this;
				var D=_this.multipleSelection[_this.multipleSelectionIndex];
				if (D) {
					loading.setText((_this.multipleSelectionIndex+1)+'/'+_this.multipleSelection.length);
					$.ajax({
						url:'/company/refreshCompany/'+D.id,
						type:'get',
						dataType:'json',
						error:function(err){
				          	loading.close();
							_this.multipleSelectionIndex=0;
					        _this.$refs.tableList.clearSelection();
						},
						success:function(ret){
							if (ret) {
								if(ret.code === 0){
									_this.multipleSelection[_this.multipleSelectionIndex].refresh_time=ret.data.refresh_time;
									_this.multipleSelectionIndex++;
									_this.refreshCompanyALLAjax();
								}else{
									_this.multipleSelectionIndex++;
									_this.refreshCompanyALLAjax();
								}
							}else{
								XYBase.error(XYBase.config.system_network_error);
					          	loading.close();
								_this.multipleSelectionIndex=0;
						        _this.$refs.tableList.clearSelection();
							}
						}
					})
				}else{
		          	loading.close();
					_this.multipleSelectionIndex=0;
			        _this.$refs.tableList.clearSelection();
				}
			},
			getCompanyInfo(row,expandedRows) {
				if (row.company_info)return;
	    		$.getJSON('/getCompanyInfo/'+row.id,function(ret){
	    			if (ret) {
	    				if (ret.code === 0) {
	    					row.company_info=1;
	    					row.data=ret.data;
	    				}else{
	    					row.company_info=2;
	    					XYBase.msg(ret.msg);
	    				}
	    			}else{
						XYBase.error(XYBase.config.system_network_error);
	    			}
	    		});
			},
	    initHtml() {
	    	var _this=this;
				// if (this.AdvancedSearchForm.length>0){
				// 	_this.search.advanceSearch=true;
				// 	_this.search.AdvancedSearchForm=_this.AdvancedSearchForm
				// }
	    	_this.search.ajax=true;
				$.ajax({
					url:'',
					type:'get',
					data:_this.search,
					dataType:'json',
					error:function(err){
	      				_this.search.ajax=false;
						XYBase.error(XYBase.config.system_network_error);
					},
					success:function(ret){
	      				_this.search.ajax=false;
						if (ret) {
							if (ret.code === 0) {
								_this.search.total=ret.data.total;
								_this.tableData=ret.data.data;
							}else{
								XYBase.msg(ret.msg);
							}
						}else{
							XYBase.error(XYBase.config.system_network_error);
						}
					}
				});
			},
			//高级搜索
			advancedSearch(){
				let _this=this;
				$.ajax({
					url:'company/advancedSearch',
					type:'post',
					data:{searchData:_this.AdvancedSearchForm,page:_this.search.page,pageSize:_this.search.pageSize,total:_this.search.total},
					dataType:'json',
					error:function(err){
						XYBase.error(XYBase.config.system_network_error);
					},
					success:function(ret){
						_this.search.ajax=false;
						if (ret) {
							if (ret.code === 0) {
								_this.search.total=ret.data.total;
								_this.tableData=ret.data.data;
							}else{
								XYBase.msg(ret.msg);
							}
						}else{
							XYBase.error(XYBase.config.system_network_error);
						}
					}
				});
			},
			//关闭弹窗
			dialogClose(){
				close
				this.centerDialogVisible=false;
				this.rowData=[];
				this.giveFormVip='';
				this.dialogTitle='';
			},
			inputOnInput(e){
			 this.$forceUpdate();
			},
			//设置弹窗页面
			centerDialogView(row){
				this.centerDialogVisible=true;
				this.dialogTitle=row.title;
				this.rowData=row;
				// console.log(row);
				this.giveFormVip=row.vid;
			},
	    exportCompany() {
	    	var _this=this;
				if (_this.selectNum<=0){
					XYBase.warning("请选择需要导出的企业");
					return false;
				}
	    	_this.search.ajax=true;
	    	var loading=XYBase.openloading();

			_this.search.selectNum=_this.multipleSelection.map(item => item.uid);
				$.ajax({
					url:'/company/exportCompany',
					// type:'get',
					type:'post',
					data:_this.search,
					dataType:'json',
					error:function(err){
	      		_this.search.ajax=false;
	      		loading.close();
						XYBase.error(XYBase.config.system_network_error);
					},
					success:function(ret){
	      		loading.close();
	      		_this.search.ajax=false;
						if (ret) {
							if (ret.code === 0) {
								window.open(ret.data.url);
							}else{
								XYBase.msg(ret.msg);
							}
						}else{
							XYBase.error(XYBase.config.system_network_error);
						}
					}
				});
			}
	    }
	});
	$(function(){
		vm.initHtml();
		reloadWindowSize();
		$(window).resize(function(){
			reloadWindowSize();
		});
	});
	function reloadWindowSize (argument) {
		var winW=$(window).width();
		if(winW <= 576){
			vm.labelPosition='top';
		}else{
			vm.labelPosition='right';
		}
	}
</script>
{include file="business"/}
{/block}